package org.jeecg.modules.basic.job;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.basic.entry.service.ILwgyElectricControlService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * TODO
 *
 * @author CSD
 * @date 2021-11-18 15:20
 */
@Slf4j
public class SampleJob implements Job {

    @Autowired
    private ILwgyElectricControlService lwgyElectricControlService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        int a = (int) (Math.random()*5)+1;
        int b = (int) (Math.random()*5)+1;
        int c = (int) (Math.random()*5)+1;
        log.info(String.format(" Jeecg-Boot 普通定时任务 SampleJob !  时间:" + DateUtils.getTimestamp()));
        lwgyElectricControlService.pushCloseRoomInfo("GA"+a,b+"1"+c);
    }
}
